<h2> Manage Images </h2>
<?php echo Message::render(); ?>
<table class="table">
    <tr>
    <?php foreach ($userImages as $userImage): ?>

        <?php if (!isset($i)) {$i = 1;} ?>

        <td>
            <p><small><?php echo $userImage['uploadDate'] ?></small></p>
            <a href="<?php echo "/" . $userImage['path'] . "/" . $userImage['newName'] ?>" target="_blank">
                <img src="<?php echo "/" . $userImage['path'] . "/thumb/" . $userImage['newName'] ?>" alt="<?php echo $userImage['name'] ?>" />
            </a>
        </td>

        <?php if ($i%5 == 0) { echo "</tr><tr>"; } ?>
        <?php $i++ ?>

    <?php endforeach; ?>
    </tr>

</table>
<?php echo $pagination ?>